Skip to content

Conversation

oleksandr-danylchenko
Copy link
Contributor

@oleksandr-danylchenko oleksandr-danylchenko commented Jun 6, 2024

Issue - #103

Changes Made

  1. redraw method to the TextAnnotator definition
  2. Added direct re-exports for the highlightRenderer methods
(Soomo Staged, 09.09.25)

@oleksandr-danylchenko
Copy link
Contributor Author

oleksandr-danylchenko commented Apr 4, 2025

Hello, @rsimon 👋🏻
I discovered a new useful case for exposing the redraw. It's needed for annotations made on scrollable tables. A consumer can add a scroll listener and, in the handler, run the:

const handleScroll = () => {
	r.state.store.recalculatePositions();
	r.redraw(true);
};

CleanShot 2025-04-03 at 14 12 18

Would it be possible to make this change a merge candidate?

@oleksandr-danylchenko
Copy link
Contributor Author

cc @rsimon, this change seems like another merge candidate for the next release 🙏🏻

setSelected,
setPresenceProvider,
setVisible,
setVisible: highlightRenderer.setVisible.bind(highlightRenderer),
Copy link
Member

@rsimon rsimon Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the binding actually necessary, given that the highlightRenderer is a function (and doesn't use this)?

Copy link
Contributor Author

@oleksandr-danylchenko oleksandr-danylchenko Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's an easy way to prevent setting a footgun. As one day we might wanna access this, and it would be great to have it properly populated.
I've just been bitten by a missing context issue too many times 😅

@rsimon rsimon merged commit 3778ee8 into recogito:main Oct 13, 2025
@oleksandr-danylchenko oleksandr-danylchenko deleted the #103-redraw-export branch October 13, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants